<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="../common/jspcommon.jsp"%>
<%@include file="../common/jscss.jsp"%>
<%@include file="../common/selfCss.jsp"%>

<script type="text/javascript">
	
		function addArtist(){
				$.post("/misc/artMade/insertArtist.htm", {
					detail : $("#detail").val(),
					name : $("#name").val(),
					photo : $("#photo").attr("src"),
					email : $("#email").val(),
					username : $("#username").val()
				}, function(data) {
					if (data == "success") {
						parent.artMadeGrid.loadData();
						alert("添加成功！");
					}
					if (data == "error") {
						alert("系统有点抽经，请稍候重试！");
					}
				});
		}
		
		function update(){
			$.post("/misc/artMade/updateArtist.htm", {
				id : $("#id").val(),
				detail : $("#detail").val(),
				name : $("#name").val(),
				photo : $("#photo").attr("src")
			}, function(data) {
				if (data == "success") {
					parent.artMadeGrid.loadData();
					alert("修改成功！");
				}
				if (data == "error") {
					alert("系统有点抽经，请稍候重试！");
				}
			});
	}
		
</script>
				


										<c:if test="${have eq 'no'}">
										<div>
										<table width="80%" class="def_t">
											<tr>
												<td style="text-align: center; color: red">添加艺术家</td>
											</tr>
										</table>
										</div>
										</c:if>
										<c:if test="${have eq 'have'}">
											<div>
													<table width="80%" class="def_t">
														<tr>
															<td style="text-align: center;color: blue">修改艺术家</td>
														</tr>
													</table>
											</div>
										</c:if>
									<table width="80%" class="def_t">
										<tr>
											<td>作者照片：</td>
											<td align="left" class="l-table-edit-td">
											<form id="upload_img_form" enctype="multipart/form-data" method="post" action="/misc/artPic/uploadImg.htm">
												<input type="file" onchange="uploadCmsImg(this);return false;""  style="width: 200px;" title="支持jpg、jpeg、gif、png格式，文件小于2M" name="imagecontent" id="imagecontent" />
												<img src="${artArtist.photo}" alt="" class="user_img" id="photo" width="100px;"height="100px"/>　
											</form>
											
											</td>
										</tr>
									</table>
											<table width="80%" class="def_t" id="tab" border="1" cellpadding="0" cellspacing="0">
												<tr>
													<td>姓名：</td>
													<td colspan="3">
														<input type="text" id="name" name="name" value="${artArtist.name }" />
														<input type="hidden" id="id" name="id" value="${artArtist.id}" />
													</td>
												</tr>
											<c:if test="${have eq 'no'}">
												<tr>
													<td>登陆账号名：</td>
													<td colspan="3"><input type="text" id="username" name="username" /></td>
												</tr>
												<tr>
													<td>登陆邮箱：</td>
													<td colspan="3"><input type="text" id="email" name="email" /></td>
												</tr>
											</c:if>	
												<tr>
													<td>简介：</td>
													<td colspan="3"><textarea id="detail" name="detail"
															cols="200" style="width: 300px">${artArtist.detail}</textarea>
													</td>
												</tr>
												
												
												
												<tr>
													<td colspan="2" style="text-align: center;">
															<c:if test="${have eq 'no'}">	<input type="button" value="添加" onclick="addArtist();"/></c:if>
															<c:if test="${have eq 'have'}">	<input type="button" value="更新" onclick="update();"/></c:if>
													</td>
												</tr>
											</table>
</body>
